CREATE EXTERNAL TABLE jms_dws.dws_wide_tms_trailer_road_dt(
  shipment_id bigint COMMENT '运单任务id',
  shipment_no string COMMENT '运单任务no',
  shipment_name string COMMENT '运单任务名',
  plate_number string COMMENT '车牌号',
  trailer_number string COMMENT '挂箱号',
  roadsection_id int COMMENT '路段编码id',
  roadsection_rank int COMMENT '路段排序',
  handling_type string COMMENT '装卸类型',
  load_start_time timestamp COMMENT '装箱开始时间',
  load_end_time timestamp COMMENT '装箱结束时间',
  run_type string COMMENT '作业类型',
  road_maleage decimal(10,4) COMMENT '路段里程',
  is_emport int COMMENT '是否空车',
  is_over_time int COMMENT '是否加班',
  return_sign int COMMENT '返程标识',
  loadrate_weight double COMMENT '装载率-质量',
  loadrate_volume double COMMENT '装载率-体积',
  load_site_planned_departure_time timestamp COMMENT '计划发车时间',
  load_site_actual_departure_time timestamp COMMENT '实际发车时间',
  unload_site_planned_arrival_time timestamp COMMENT '计划到车时间',
  unload_site_app_arrival_time timestamp COMMENT '实际到车时间',
  plan_driving_time timestamp COMMENT '计划行驶时间',
  actual_driving_time timestamp COMMENT '实际行驶时间',
  load_site_scantime timestamp COMMENT '装车扫描时间',
  load_site_app_departure_time timestamp COMMENT 'app离开时间',
  next_unload_site_scantime timestamp COMMENT '下一站app到达时间',
  weight_arrival_time timestamp COMMENT '过磅进站时间',
  weight_departure_time timestamp COMMENT '过磅出站时间',
  gps_arrival_time timestamp COMMENT 'gps到达时间',
  gps_departure_time timestamp COMMENT 'gps离开时间',
  plan_frequency string COMMENT '计划发车频次',
  actual_frequency string COMMENT '实际发车频次',
  forecast_frequency string COMMENT '预测参加频次:实际发车+计划在途时长（+1h)',
  is_delay int COMMENT '是否延误',
  bill_weight decimal(20,4) COMMENT '快件总重量',
  bill_fee_weight decimal(20,4) COMMENT '快件计费总重量',
  shipment_state int COMMENT '任务状态',
  mileage decimal(10,4) COMMENT '任务里程',
  vehicleline_type int COMMENT '路线类型:支线 干线',
  shipment_start_code string COMMENT '任务的起始网点code',
  shipment_start_name string COMMENT '任务的起始网点name',
  shipment_plan_start_time timestamp COMMENT '任务计划开始时间',
  shipment_departure_start_time timestamp COMMENT '任务实际开始时间',
  shipment_gps_departure_time timestamp COMMENT '任务在起始网点的gps开始时间',
  shipment_end_site_code string COMMENT '任务目的网点编码',
  shipment_end_site_name string COMMENT '任务目的网点名称',
  shipment_plan_end_time timestamp COMMENT '任务计划到车时间',
  shipment_departure_end_time timestamp COMMENT '任务实际到车时间',
  shipment_gps_arrival_time string COMMENT '任务目的网点的gps到车时间',
  start_center_in_volume decimal(24,4) COMMENT '始发中心进港方数',
  start_center_in_weight decimal(24,4) COMMENT '始发中心进港重量',
  start_center_bill_total bigint COMMENT '始发中心票数',
  start_cneter_package_cnt bigint COMMENT '始发中心包数',
  start_center_package_bill_cnt bigint COMMENT '始发中心包内票数',
  start_center__bill_cnt bigint COMMENT '始发中心单票数',
  end_center_in_volume decimal(24,4) COMMENT '目的中心进港方数',
  end_center_in_weight decimal(24,4) COMMENT '目的中心进港重量',
  vehicletype_id string COMMENT '车型id',
  vehicletype_name string COMMENT '车型name',
  max_volume decimal(10,4) COMMENT '荷载体积',
  max_weight decimal(10,4) COMMENT '荷载重量',
  carrier_id string COMMENT '承运商ID',
  carrier_name string COMMENT '承运商名称',
  driver_name string COMMENT '主驾姓名',
  driver1_tel string COMMENT '主驾电话',
  driver2 string COMMENT '副驾姓名',
  driver2_tel string COMMENT '副驾电话',
  actual_start_date_type string COMMENT '发车时间类型',
  actual_end_date_type string COMMENT '到车时间类型',
  oil string COMMENT '油耗',
  trailer_car_type string COMMENT '挂车车厢类型',
  center_one_disp_date string COMMENT '网点一派时间',
  center_two_disp_date string COMMENT '网点儿派时间',
  center_three_disp_date string COMMENT '网点三派时间')
COMMENT '运力挂箱聚合宽表'
PARTITIONED BY (dt string COMMENT '分区字段-任务开始时间')
stored as parquet
LOCATION '/dw/hive/jms_dws.db/external/dws_wide_tms_trailer_road_dt'
tblproperties (
'discover.partitions'='false',
'parquet.column.index.access'='true'
    )
;